home *** CD-ROM | disk | FTP | other *** search
/ Ham Radio 2000 #2 / Ham Radio 2000 - Volume 2.iso / HAMV2 / TCP_IP / TNOS230S / ECCMD.C < prev    next >
Encoding:
C/C++ Source or Header  |  1996-12-23  |  1.1 KB  |  46 lines

  1. #ifdef MSDOS
  2. /* 3C501 commands
  3.  * Copyright 1991 Phil Karn, KA9Q
  4.  */
  5. #include "global.h"
  6. #ifdef PC_EC
  7. #include "mbuf.h"
  8. #include "iface.h"
  9. #include "ec.h"
  10. #include "enet.h"
  11.  
  12. #if !defined(_lint)
  13. static char rcsid[] OPTIONAL = "$Id: eccmd.c,v 1.7 1996/12/23 20:37:36 root Exp root $";
  14. #endif
  15.  
  16. int
  17. doetherstat(argc,argv,p)
  18. int argc;
  19. char *argv[];
  20. void *p;
  21. {
  22.     register struct ec *ecp;
  23.     char buf[20];
  24.  
  25.     for(ecp = Ec;ecp < &Ec[Nec]; ecp++){
  26.         (void) pether(buf,ecp->iface->hwaddr);
  27.         tprintf("Controller %u, Ethernet address %s\n",
  28.         (unsigned int)((ecp-Ec) / sizeof(struct ec)),buf);
  29.  
  30.         tputs("recv      bad       overf     drop      nomem     intrpt\n");
  31.         tprintf("%-10lu%-10lu%-10lu%-10lu%-10lu%-10lu\n",
  32.          ecp->estats.recv,ecp->estats.bad,ecp->estats.over,
  33.          ecp->estats.drop,ecp->estats.nomem,ecp->estats.intrpt);
  34.  
  35.         tputs("xmit      timeout   jam       jam16\n");
  36.         if(tprintf("%-10lu%-10lu%-10lu%-10lu\n",
  37.          ecp->estats.xmit,ecp->estats.timeout,ecp->estats.jam,
  38.          ecp->estats.jam16) == EOF)
  39.             break;
  40.     }
  41.     return 0;
  42. }
  43.  
  44. #endif  /* PC_EC */
  45. #endif    /* MSDOS */
  46.